<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'导入客户'))}
	<form method='post' id="form_data" enctype="multipart/form-data">
		<input type="hidden" name="opmode" value="import">
		<ol class="spaced">
			<li class="col-xs-12 line-height-32">
				<a class="btn btn-primary" href="/{:C('TEMPLETE_PATH')}/customer.xlsx" target="_blank"><i class="fa fa-download"></i>下载Excel格式&nbsp;</a>
			</li>
			<li class="col-xs-12 line-height-32">
				按照Excel格式，整理客户信息，不要调整列循序
			</li>
			<li class="col-xs-12 line-height-32">
				选择要导入的文件&nbsp;
				<input style="height:42px" type="file"  name="uploadfile" value="" class="form-control col-30">
			</li>
		</ol>
		<div class="action">
			<input class="btn" type="button" value="导入" id="btn_save">
			<a  class="btn btn-return" onclick="go_return_url();">取消</a>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var $ = layui.jquery;

			$("#btn_save").on('click', function() {
				send_form("form_data", "{:url('import')}", "{:url('index')}", function(ret) {
					if (ret.status) {
						layer.msg(ret.info);
						location.href = "{:url('index')}";
					} else {
						layer.msg(ret.info);
						return false;
					}
				});
			});
		});
	</script>
</block>